<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        padding: 0;
        margin: 0;
    }
    body {
        perspective: 1000px;
    }
    ul {
        list-style: none;
    }
    .container {
        margin: 0 auto;
        margin-top: 30px;
        width: 300px;
        height: 40px;
        background-color: antiquewhite;
    }
    .container ul li {

        position: relative;
        float: left;
        width: 100px;
        height: 40px;
        transform-style: preserve-3d;
        transition: all .5s;
        /* 就是为了方便查看元素 */
        /* transform: rotateX(-20deg) rotateY(30deg) ; */
        
    }
    
    .container ul li a {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        line-height: 40px;
        text-align: center;
        text-decoration: none;
        color: wheat;
    }
    
    .container ul li a:first-child {
        background-color:green;
        transform: translateZ(20px);
    }

    .container ul li a:last-child {
        
        background-color: orange;
        transform: rotatex(90deg) translateZ(20px)

    }

    .container li:hover {
        transform: rotateX(-90deg);
    }

</style>

<body>
    <div class="container">
        <ul>
            <li>
                <a href="">首页</a>
                <a href="">Index</a>
            </li>
            <li>
                <a href="">首页</a>
                <a href="">Index</a>
            </li>
            <li>
                <a href="">首页</a>
                <a href="">Index</a>
            </li>
        </ul>
    </div>
</body>

</html>